<?php
function getForms($form='') {
	global $objDB;
	$aForms = array();
	$codForm = 'agenmemo';
	$aForms[$codForm]['descr'] = 'Agenda - Memo';
	$aForms[$codForm]['dir'] = '/agen';
	$aForms[$codForm]['files']['ovf_agenda']['alias'] = 'M';
	$aForms[$codForm]['campiFix'] = 'id_agenda';
	
	$codForm = 'agenimpe';
	$aForms[$codForm]['descr'] = 'Agenda - impegno';
	$aForms[$codForm]['dir'] = '/agen';
	$aForms[$codForm]['files']['ovf_agenda']['alias'] = 'M';
	$aForms[$codForm]['campiFix'] = 'id_agenda';
	
	$codForm = 'anagraf';
	$aForms[$codForm]['descr'] = 'Anagrafica';
	$aForms[$codForm]['dir'] = '/rcom/anag';
	$aForms[$codForm]['files']['ovf_anagrafiche']['alias'] = 'A';
	$aForms[$codForm]['campiFix'] = 'id_anag,cod_anag,intestaz1';
	
	$codForm = 'testasez';
	$aForms[$codForm]['descr'] = 'Testata sezioni anagrafica';
	$aForms[$codForm]['dir'] = '/rcom/anag';
	$aForms[$codForm]['files']['ovf_anagrafiche']['alias'] = 'A';
	$aForms[$codForm]['campiFix'] = 'id_anag,cod_anag,intestaz1';
		
	$codForm = 'contatti';
	$aForms[$codForm]['descr'] = 'Contatto';
	$aForms[$codForm]['dir'] = '/rcom/cont';
	$aForms[$codForm]['files']['ovf_anag_contatti']['alias'] = 'S';
	$aForms[$codForm]['campiFix'] = 'id_contatti';
	
	$codForm = 'referent';
	$aForms[$codForm]['descr'] = 'Referente';
	$aForms[$codForm]['dir'] = '/rcom/refe';
	$aForms[$codForm]['files']['ovf_anag_referent']['alias'] = 'S';
	$aForms[$codForm]['campiFix'] = 'id_referent';
	
	$codForm = 'campagne';
	$aForms[$codForm]['descr'] = 'Campagne';
	$aForms[$codForm]['dir'] = '/rcom/camp';
	$aForms[$codForm]['files']['ovf_campagne']['alias'] = 'C';
	$aForms[$codForm]['campiFix'] = 'id_camp,descr';
	
		
	$sSql = "SELECT * FROM ovf_anag_sez WHERE tipo_sez <> 'ext'";
	$objDB->query($sSql,"selAnagSezGF");
	while($acX = $objDB->fetch("selAnagSezGF")) {
		$codForm = $acX['cod_sez'];
		if (isset($aForms[$codForm])) {
				continue;
		}
		$aForms[$codForm]['descr'] = $acX['descr'];;
		$aForms[$codForm]['dir'] = '/rcom/asez';
		$aForms[$codForm]['files']['ovf_sez_'.$codForm]['alias'] = 'S';
		$aForms[$codForm]['campiFix'] = 'id_'.$codForm;
	}
	if ($form=='')	return $aForms;
	if (isset($aForms[$form])) return $aForms[$form];
	return false;
}
